package com.next

import grails.transaction.Transactional

@Transactional
class IssueTeamService
{

    def initIssueTeam(Issue issue, User user)
    {
        def issueTeam = IssueTeam.find("from IssueTeam where issue.id = :issue and user.id = :user",
                                       [issue: issue.id, user: user.id])

        if (!issueTeam)
        {
            issueTeam = new IssueTeam()
            issueTeam.issue = issue
            issueTeam.user = user
            issueTeam.save flush: true
        }
    }
}
